#ifndef __Hostility_H_
#define __Hostility_H_

#include <irrlicht.h>
#include <iostream>
#include <fstream>
#include <map>

#include "Entity.h"


/*! Class defining NPC's entity toward each others and the player*/
class Hostility
{
	public:
    	/*! the reaction_t defines the differents reactions that a NPC can have */
	typedef enum
	{
		HOSTILE,
		FEARED,
		NEUTRAL,
		ALLIED,
		UNDEFINED
	}reaction_t;  

	protected:
    	/*! This is a list linking a reaction to a type of entity */
	std::map<irr::core::string<c8>,reaction_t> hostilities__ ;
	
	public:
	/*! empty constructor */
	Hostility();
	/*! constructor from file */
	Hostility(const std::string& entity_type);
	/*! destructor */
	virtual ~Hostility();
	
	void loadFromFile(const std::string& entity_type);

	/*! set the reaction for a type of creature */ 
	void setReaction(irr::core::string<c8> type,reaction_t react);
	/*! returns the reaction to a type of creature */
	reaction_t getReaction(irr::core::string<c8> type);
	/*! the operator [] offers direct access to the reaction by giving a type */
	reaction_t& operator[](irr::core::string<c8> type);
	/*! returns a reference to the list of all hostilities */
	std::map<irr::core::string<c8>,reaction_t>& gethostilities();	 
};

/*! << overloading in order to display the whole list of desires when cout is invoked on the hostility structure */
std::ostream& operator<<(std::ostream& os, Hostility::reaction_t r);

#endif

